<template>
	<div class="control-left app-control-menu__left">
		<a-input />
		<a-menu @click="handleMenuClick" mode="inline">
			<template v-for="item in menus" :key="item.name">
				<AppMenuitem :item="item"></AppMenuitem>
			</template>
		</a-menu>
	</div>
	<div class="control-right app-control-menu__right">
		<component
			:is="props.openViewCodeName"
			:context="props.context"
			:viewParams="props.viewParams"
			:name="props.openViewCodeName"
			openType="EMBED"
		/>
	</div>
</template>
<script lang="ts" setup>
import AppMenuitem from './menu-item.vue';
import { MenuProps } from '../menu';
const props = defineProps(MenuProps);
const emit = defineEmits(['menuClick']);
const handleMenuClick = ({ key }: any): void => {
	emit('menuClick', key);
};
</script>
